home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Periodicals / develop / develop Issue 10 / develop 10 code / Is it Art? / ArtMaker / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-08  |  1.1 KB  |  54 lines  |  [TEXT/KAHL]

  1. # include    "Shell.h"
  2.  
  3. extern Rect                gDeskRect;
  4. extern MenuHandle        gShellMenuHandles[];
  5.  
  6. /*-------------------------------------------------------------------------
  7. initshell()            Inits all the application-specific variables...
  8. -------------------------------------------------------------------------*/
  9.  
  10. initshell()
  11. {
  12.     MenuHandle        mhndl;
  13.     Rect            temprect;
  14.     short             err, cnt;
  15.     unsigned long    seed;
  16.     
  17.     /* Get Bounding box of Desktop  */
  18.     gDeskRect = (**GetGrayRgn()).rgnBBox;
  19.     
  20.     /* Reset random number generator  */
  21.     GetDateTime(&seed);
  22.     randSeed = seed;
  23.  
  24.     /* Read in menus, draw the bar... */
  25.     mhndl = GetMenu(kAppleMenuID);
  26.     if(mhndl == nil)
  27.         BailOut();
  28.     AddResMenu(mhndl, 'DRVR');
  29.     InsertMenu(mhndl, 0);
  30.     (*mhndl)->menuID = kAppleMenuID;
  31.     gShellMenuHandles[kAppleMenu] = mhndl;
  32.     
  33.     mhndl = GetMenu(kFileMenuID);
  34.     if(mhndl == nil)
  35.         BailOut();
  36.     InsertMenu(mhndl, 0);
  37.     (*mhndl)->menuID = kFileMenuID;
  38.     gShellMenuHandles[kFileMenu] = mhndl;
  39.     
  40.     mhndl = GetMenu(kEditMenuID);
  41.     if(mhndl == nil)
  42.         BailOut();
  43.     InsertMenu(mhndl, 0);
  44.     (*mhndl)->menuID = kEditMenuID;
  45.     gShellMenuHandles[kEditMenu] = mhndl;
  46.     
  47.     DrawMenuBar();
  48.     
  49.     /* Init the App's stuff */
  50.     if(!AppInit())
  51.         BailOut();
  52. }
  53.  
  54.